package com.cskaoyan.bean.order.vo;

import com.cskaoyan.bean.order.OrderGoods;
import com.cskaoyan.typehandler.StringArrayTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.xml.crypto.Data;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 创建日期: 2022/05/06 15:55
 *
 * @author JinLu Zhou
 */
@lombok.Data
public class OrderGoodsVo {

    Date addTime;
    Integer comment;
    boolean deleted;
    Integer goodsId;
    String goodsName;
    String goodsSn;
    Integer id;
    Short number;
    Integer orderId;
    String picUrl;
    BigDecimal price;
    Integer productId;
    String[] specifications;

    Date updateTime;


    public void set(OrderGoods orderGoods) {
        setAddTime(orderGoods.getAddTime());
        setComment(orderGoods.getComment());
        setDeleted(orderGoods.getDeleted());
        setGoodsId(orderGoods.getGoodsId());
        setGoodsName(orderGoods.getGoodsName());
        setGoodsSn(orderGoods.getGoodsSn());
        setId(orderGoods.getId());
        setNumber(orderGoods.getNumber());
        setOrderId(orderGoods.getOrderId());
        setPicUrl(orderGoods.getPicUrl());
        setPrice(orderGoods.getPrice());
        setProductId(orderGoods.getProductId());
        setUpdateTime(orderGoods.getUpdateTime());
        /*String specifications = orderGoods.getSpecifications();

        String[] transfer = new StringArrayTypeHandler().transfer(specifications);
        setSpecifications(transfer);*/
        setSpecifications(orderGoods.getSpecifications());
    }
}
